package org.streets.eis.component.modal;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.streets.eis.component.buttonededit.ButtonedEdit;
import org.streets.eis.component.model.ListItem;
import org.streets.eis.pages.ModalPage;

public class ButtonedEditCloseCallback  implements ModalWindow.WindowClosedCallback{

	private static final long serialVersionUID = 1L;

	private ButtonedEdit component;
	
	private ModalPage<ListItem> page;
	
	public ButtonedEditCloseCallback(ButtonedEdit edit,ModalPage<ListItem> page){
		this.component = edit;
		this.page = page;
	}
	
	public void onClose(AjaxRequestTarget target) {
		
		component.setValue(page.getModalResult(), target);
		
	}

}
